<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>栏目树</title>
    <s:head/>
</head>
<script type="text/javascript">
    var setting = {
        async: {
            enable: true,
            url: "sysval-treeBusiness",
            type: "post",
            dataType: "json",
            autoParam: ["id=pid"],
            dataFilter: ajaxDataFilter
        },
        data: {
            keep: {
                parent: true
            },
            key: {
                name: "chn"
            }
        },
        callback: {
            onClick: function (event, treeId, treeNode, clickFlag) {
                if (treeNode.isParent) {
                    $("#center", window.parent.document).attr("src", "msgTemplate-find?sysMsgTemplate.process.bizType=" + treeNode.identifier + "&sysMsgTemplate.company.id=" + "${sessionScope.CURRENT_USER.getCompany().id}");
                }
                return;
            }
        }
    };

    function ajaxDataFilter(treeId, parentNode, responseData) {
        if (!responseData.systemValues)return null;
        return responseData.systemValues;
    }
    ;

    /**初始化业务树*/
    $(function () {
        $.fn.zTree.init($("#msgSettingTree"), setting);
    });

    function refresh() {
        $.fn.zTree.getZTreeObj("msgSettingTree").reAsyncChildNodes(null, "refresh");
    }
</script>
<body class="ui-widget-content" style="height: 100%">
<div style="width: 15%; float: left;">
    <ul id="msgSettingTree" class="ztree"></ul>
</div>
</body>
</html>
